<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>


<img src="1.gif" />
<img src="2.gif" name="news" />
<script type="text/javascript">

var images = document.getElementsByTagName("img");
var news = images.namedItem("news");

var allElements = document.getElementsByTagName("*");

</script>
</body>
</html>
